package com.bluesky.jwf.component.fake;

import java.io.IOException;
import java.io.Writer;

import com.bluesky.common.TreeNode;
import com.bluesky.javawebbrowser.domain.html.tags.Tag;
import com.bluesky.jwf.component.Component;

/**
 * Linker is a fake component, it is used to link to an component which is a
 * child of another component. i.e. the Tabs component want to link to the
 * BodyTag of a Window component.
 * 
 * @author jack
 * 
 */
public class Linker extends Component {

	private Tag target;

	public Linker(Tag target) {
		this.target = target;
	}

	@Override
	public void writeHtml(Writer writer) throws IOException {
		if (!visible)
			return;

		if (target != null)
			target.writeHtml(writer);
	}
}
